package com.gitee.jisong.superredis.serv

import com.gitee.jisong.superredis.dao.ServersDao
import com.gitee.jisong.superredis.pojo.RedisServers
import org.springframework.stereotype.Service
import javax.annotation.Resource

@Service
class ServersServ {

    @Resource
    lateinit var serversDao:ServersDao

    fun queryPage(offset: Long = 0, limit: Long = 50) : List<RedisServers> {
        val pages: List<RedisServers> = serversDao.queryPage(offset, limit)
        return pages
    }

    fun saveInsert(redisServers: RedisServers) : Int {
        return serversDao.insert(redisServers)
    }

    fun saveUpdate(redisServers: RedisServers): Int {
        return serversDao.updateById(redisServers)
    }
}